package org.zoomdev.zoom.web.parameter.parser.impl;

import org.apache.commons.fileupload.FileItem;
import org.zoomdev.zoom.web.parameter.ParameterAdapter;
import org.zoomdev.zoom.web.parameter.ParameterAdapterFactory;
import org.zoomdev.zoom.web.parameter.ParameterAdapterFactoryManager;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Type;

public class UploadParameterAdapterFactory implements ParameterAdapterFactory {
    @Override
    public ParameterAdapter createParameterAdapter(String name, Type type, AnnotatedElement element) {
        if (type == FileItem.class) {
            return ParameterAdapterFactoryManager.DIRECT_ADAPTER;
        }
        return null;
    }
}
